home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / lib / tex / lgraph.shar / lgraph.readme < prev    next >
Encoding:
Text File  |  1988-04-18  |  23.5 KB  |  564 lines

  1.             PLOTTING GRAPHS WITH LaTeX
  2.             --------------------------
  3.                     sunil podar (podar@sbcs.csnet)
  4.                     ...!{allegra, philabs}!podar!sbcs
  5. last update: Feb 2, 1987 (fixed bugs: wasn't doings things right when (0,0)
  6.     was not on the graph. Also removed the printing of a few of the
  7.     margin commands from preamble. Added some more defaults.
  8. last update: Oct 5, 1986
  9.     Added the ability to plot any quadrant.
  10.     Changed the characters numbers from digits to Capital Letters.
  11.     removed "X --->". Now prints X and Y near the axes vector-heads.
  12.     Some parameters changed: NEW: %picdimens,%[XY]deltab:n,%[XY]orig-num
  13.     DELETED: %picheight,%piclength,%want-X^Y^,%[XY]deltabar,%[XY]deltanum
  14. last update: Apr 14 1985 original version.
  15.  
  16.  
  17. This program provides an integrated (somewhat) system to plot graphs. Latex
  18. has a fairly powerful pic environment but it lacks any direct graph
  19. environment, and this program attempts to simulate one.
  20.  
  21. You must have some knowledge of LaTeX, and in particular the pic environment
  22. if there is any need to change the output of this program. Actually if you
  23. know only the pic environment, you should be able to manage.
  24.  
  25. The program can produce the graph as a complete document if you desire. The
  26. idea is that even non-LaTeX users can plot graphs and only graphs and it
  27. doesn't have to be part of regular text. 
  28.  
  29. The program, using the options given in the parameter list, produces a LaTeX
  30. file using all known-to-work and regular LaTeX commands and the file can
  31. easily be edited if needed. So, the moral is that one can plot graphs with
  32. being quite oblivious to the fact that LaTeX is being used to plot it; of
  33. course, you have to run LaTeX on the graph to print it.
  34.  
  35. Please feel free to contact me (podar@sbcs) if there are any bugs, if it
  36. doesn't do what you want and can't figure out how to do it, or would like
  37. some other features in the program. I have not tested the program extensively
  38. so I can't promise it will work if you try to stretch it to its limits. I do
  39. not have complicated error-checking or error-recovery. If you make any
  40. modifications to this program, please let me know.
  41.  
  42. The program generates LaTeX commands to do the following:
  43.  
  44. 1. print the X-axis vector.
  45. 2. print the Y-axis vector.
  46. 3. put little vertical bars on the X-axis at regular intervals.
  47. 4. put little horizontal bars on the Y-axis at regular intervals.
  48. 5. put numbers along those bars on both axes.
  49. 6. prints "X" and "Y" along the axes.
  50. 7. sets up a legend box with info about X-axis, Y-axis and the various
  51.    characters plotted on the graph; controlled by a variety of options.
  52. 8. reads input data in 3-tuples (character# X-coordinate Y-coordinate),
  53.    scales the data according to given scale and generates commands to plot
  54.    it. If there is no data, then it simply produces the skeleton graph.
  55.  
  56.  
  57. some quirks, limitations, suggestions, ideas regarding the program
  58. ------------------------------------------------------------------
  59. The program is not a very powerful program and the code is rather sloppy,
  60. but I attempt to do things right as far as possible
  61. and if not then I give pointers to how one might have to edit the output
  62. file. Some of the commands that I generate are highly dependent on the font
  63. being used, the unitlength etc., so I can only make a reasonable attempt to
  64. get things right. In order to use this program, I suggest that
  65. you print out the file produced by the program and then see what needs
  66. fixing; in most cases the fixing will be limited to changing a few
  67. coordinates of some commands.
  68.  
  69. You can of course use the program to generate a dummy skeleton graph even if
  70. all you need is a few things out of the 8 steps listed above and extract
  71. out of the file the desired portion. The format of the graph is my personal
  72. preference and differs from other graph plotting packages that plot the
  73. graph within a bounded rectangle (such as graph(1) of unix.)
  74.  
  75. The program may not give you what you desire but there are ways of
  76. still exploiting it if what you need is not what it can handle. For
  77. instance, you can use it to translate input data (the coordinate pairs)
  78. to the "\put" statements with desired scaling factors.
  79.  
  80. 1. It can plot any or all quadrants. Shifted origins also handled.
  81.  
  82. 2. I try to act smart when printing numbers along the axes. If I figure that
  83.    the numbers are whole numbers (xx.00) then I print integers, otherwise I
  84.    print real numbers with two significant digits. You can easily edit the
  85.    file if you want more or less significant digits.
  86.  
  87. 3. Since Pascal is very unfriendly when it comes to handling character strings
  88.    the syntax of the parameters is a bit unfriendly too. Also the max string
  89.    size that I can handle is 80 chars, and if you need more than that, you
  90.    can give less to the program and then edit the output file without any
  91.    difficulty. I give a lot of comments at appropriate places (all begin with
  92.    a % since that is a latex comment char), you can safely get rid of them in
  93.    your final document.
  94.  
  95. 4. What I regard as a misfeature in LaTeX (could pass for just a quirk), the
  96.    \caption command ALWAYS prints the "Figure 2.2" in normalsize no matter
  97.    what your environment fonttype is or what you specify in the caption
  98.    arguement. So, to get around it I have a command that explicitly puts a
  99.    caption-look-alike caption at the bottom of the figure in the specified
  100.    font. If you choose to print LaTeX caption then I force a normalsize
  101.    caption but if you want everything in another font then use "explicit"
  102.    option on the ??caption parameter. Since LaTeX decides the figure number
  103.    by itself, I ignore the "fignumber" parameter if you chose the "LaTeX"
  104.    option; on the other hand I ignore the "labelname" parameter if you chose
  105.    the "explicit" option. If you need things other than what the program
  106.    gives you you can explicitly edit the file.
  107.  
  108. 5. From my experience & personal preference, font "small" or even smaller
  109.    looks nice on the graph; normalsize comes out a bit too big and looks
  110.    unwieldly, specially for printing large real numbers along the Y-axis.
  111.    
  112. 6. If you are going to have many such graphs in one document, then doing 
  113.    the following will make life easier:
  114.    a. have \newcommand{\pcharA}{} 
  115.            ...........
  116.            \newcommand{\pcharF}{}
  117.        \newcommand{\xaxis}{}
  118.        \newcommand{\yaxis}{}
  119.       in the preamble of the document; this just initializes the name to null.
  120.    b. change all subsequent "\newcommand"s in each of the graphs to
  121.       "\renewcommand".
  122.  
  123. 7. The syntax for running the program is
  124.  
  125.         latexgraph <infile >outfile   (use outfile.tex if standalone)
  126.  
  127.    infile should have, besides the parameters, only the data lines with 
  128.    1 capital letter and 2 numbers on each line:
  129.  
  130.    LETTER1 Xreal2 Yreal3
  131.  
  132.    LETTER1: range= A..F
  133.             it is the code for the kind of character to be plotted at the
  134.          specified coordinates.
  135.    Xreal2  : is the X-coordinate of the point to be plotted, a real number.
  136.    Yreal3  : is the Y-coordinate of the point to be plotted, a real number.
  137.  
  138.    For input file, a file-name-extension of the form ".gra" or ".in" could
  139.    be used with a ".tex" for the output. The output file(s) can
  140.    subsequently be simply "\input" into the main document, if any.
  141.  
  142. 8. The numbers along the axes are always below the X-axis and to the left
  143.    of Y-axis. If you desire them differently, for intance, in the case of a
  144.    2nd quadrant graph, then you will have to manually change the coordinates
  145.    in the output file. (I didn't feel like adding yet another option!).
  146.  
  147. 9. However ugly the scheme of taking parameters may appear, it has many
  148.    advantages and that's why it was decided upon:
  149.    a. Some of the options could easily be implemented as command line
  150.       options but then you may not remember which graph has what options. 
  151.       With the implemented scheme, all the information required for a graph
  152.       can be put into one file and forgotten about.
  153.    b. portability of the program. many computers do not have unix(tm) like
  154.       facilities for command-line options.
  155.  
  156. 10. I have been asked often, how about providing for "joining the dots".
  157.    Well, there is a companion (actually, quite independent of this program)
  158.    TeX macro package called "epic" authored by myself. It is implemented as a
  159.    documentstyle option and contains several high-level commands for the
  160.    picture environment including line-drawing commands for dotted, dashed, and
  161.    solid lines. It also contains macros that define corresponding
  162.    environments. All these line drawing commands draw straight line segments
  163.    (no smooth curves). Instead of describing things in more details, I suggest
  164.    you acquire that package and read the corresponding documentation, which
  165.    contains an example of how to add line-drawing commands to the output of
  166.    this program. You may obtain the "epic" package from the same source as you
  167.    obtained this, or send mail to me; I perfer that the former channel be
  168.    explored first. Due to lack of motivation and fear of further complicating
  169.    things, I have not implemented options in this program that interface with
  170.    the "epic" package. Hence, you will have to explicitly edit the output to
  171.    incorporate commands to join the dots; I assure you it is very easy and
  172.    requires very minimal editing.
  173.  
  174. Syntax of the parameters:
  175. -------------------------
  176.  
  177. 1.  All parameters are recognized by the string of 10 characters at the 
  178.     beginning and exactly 10 characters -- no more -- no less. They all
  179.     begin with a % sign because that is the comment character for latex. The 
  180.     "%" is quite unnecessary, but remains for historical reasons.
  181.  
  182. 2. When the arguement for a parameter is an integer then there MUST be atleast
  183.    one blank after the parameter name and for more than one integer, again
  184.    blank char is the separater.
  185.  
  186. 3. When the arguement for a parameter is a string then there MUST BE NO BLANK
  187.    and instead it should be a /. The string that follows the / is taken 
  188.    exactly as it appears starting from the next character including any 
  189.    blanks. All that is important is that the 11th char be a /.
  190.  
  191. 4. There should be no blank lines before or  in the middle until the string
  192.    '%%%%%%%%%%' . That string of 10 %'s ends the list of arguements. I don't
  193.    think there should be any blank lines anywhere at all.
  194.  
  195. 5. The list of parameters SHOULD be the first thing in the file , that is, 
  196.    right on the top followed by data, if any. Without any data, you will
  197.    simply get the skeleton of the graph with all things laid out. This is
  198.    one way to make use of this program if you already have explicit statements
  199.    for plotting the points; first get the graph skeleton, and then insert
  200.    your file with latex commands that plot points at the appropriate place.
  201.    
  202. 6. There are 6 parameters for plotting chars at the specified coordinates.
  203.    That means with this program you can have 6 kinds of data plotted in one
  204.    graph. The parameters are %plotcharA .. %plotcharF. Each parameter has
  205.    a LETTER at the end and that is very significant. The data to be plotted
  206.    must have as its first argument a LETTER A..F that directly corresponds
  207.    to the plotchar# defined in the parameter list. E.g. the data line
  208.    B 20 30  => put plotcharB at (X,Y)=(20,30) on the graph. The idea is that
  209.    I imagine that you will have some program that produces numbers to be
  210.    plotted and you can have that program produce the 3-tuples needed for
  211.    this program very easily.
  212.    There are five corresponding plotname's too. These are short strings
  213.    of upto 25 characters that are used in the legendbox for names of the
  214.    plotchar symbols. You ought to keep them short else the box will become
  215.    too big.
  216.    
  217.    You do not have to have all the 6 char & names. In the input file, you
  218.    may have only as many of the six set as necessary. By default, the
  219.    unlisted char is a 'no'.
  220.  
  221. 7. For some options there are default values, hence you need not have them
  222.    in the input file unless values other than the default ones are desired.
  223.    The default values are (only for the ones listed here):
  224.    %pre&post?/no
  225.    %unitlngth  1.0    (i.e. 1mm)
  226.    %font-name/{normalsize}
  227.    %picdimens 100 100 0 0
  228.    %??caption/no
  229.    %labelname/no
  230.    %legendloc/no
  231.    %Xratiog:r 10 10    (* 1 : 1 *)
  232.    %Xdeltab:n 5 10    (* numbers on alternate bars *)
  233.    %Xoriginum 0
  234.    %Yratiog:r 10 10    (* 1 : 1 *)
  235.    %Ydeltab:n 5 10    (* numbers on alternate bars *)
  236.    %Yoriginum 0
  237.    %plotcharA/no
  238.    %plotnameA/A
  239.    %plotcharB/no
  240.    %plotnameB/B
  241.    .....
  242.    %plotcharF/no
  243.    %plotnameF/F
  244.  
  245. The options are as follows:
  246.  
  247. command        arguments    explanation
  248. -------        ---------    -----------
  249.  
  250. %pre&post?/    yes        writes the preamble & post-amble alongwith
  251.                 the graph. idea is to have a standalone 
  252.                 graph i.e. a complete document.
  253.         no        doesn't write any preamble or post-amble.
  254.                 starts with \begin{figure}...... 
  255.                 & ends with \end{figure}.
  256.  
  257. %unitlngth    mm real        the unitlength for the graph.
  258.  
  259. %font-name/    {fontname}    one of the many fontnames that LaTeX provides,
  260.                 such as normalsize,tt,small, etc. All the 
  261.                 printed stuff on the graph will be in the spe-
  262.                 cified font. MUST put the {} around fontname.
  263.  
  264. %picdimens     picwd picht Xorigin Yorigin
  265.         All the four must be integers and in graph units. All four
  266.         must be specified even if they are 0. max graph height about
  267.         200mm or so. max graph width is about 240mm. For larger than
  268.         about 170mm you need to do -L on dvi-imagen, which also means
  269.         you have to print this page separately, since just a page
  270.         can't be rotated by latex or dvi-imagen.
  271.  
  272.         Xorigin & Yorigin have special significance and should be
  273.         chosen with care.
  274.         To understand business about [XY]origin you should have read
  275.         the details about origin of picture environment in the LaTeX
  276.         book. [XY]origin refers to the coordinate of the bottom-left
  277.         corner of the whole picture box in which the graph resides.
  278.         Together with the width and the height of the picture box,
  279.         they determine the layout of the graph as to which of the
  280.         quadrants constitute the graph and what is the desired
  281.         origin of the graph. Note that [XY]origin refer to the
  282.         origin of the overall picture box and not of the underlying
  283.         graph. E.g.
  284.  
  285.         %picdimens 100 100 -50 -50
  286.         denotes a picture box of size 100x100 whose bottom left
  287.         corner is (-50,-50) and thus the graph origin (0,0) lies in
  288.         the middle of the picture box. This graph will have all four
  289.         quadrants.
  290.         
  291.         %picdimens 100 100 -100 0
  292.         denotes a picture box of size 100x100 whose bottom left
  293.         corner is at (-100,0) and thus the graph origin (0,0) lies
  294.         at the bottom-right corner. This graph will be only the 2nd
  295.         quadrant.
  296.         
  297.         %picdimens 100 100 50 50
  298.         denotes a picture box of size 100x100 whose bottom left
  299.         corner is at (50,50) and so is its graph origin. This is a
  300.         shifted 1st quadrant.
  301.         
  302.         One way to decide the 4 numbers for %picdimens is to draw on
  303.         a piece of paper a rectangle and decide where you want your
  304.         graph origin and what are its coordinates. Then figure out
  305.         what are the coordinates of the bottom-left corner of the
  306.         enclosing rectangle.
  307.  
  308. %Xaxisstrg/    string        max char 80.for xaxis to appear in the legend
  309.                 box and/or in the caption.
  310.                 It should be kept small so as not to make
  311.                 the box too large.
  312.  
  313. %Yaxisstrg/    string         for yaxis ................. same as above.
  314.  
  315. %??caption/    LaTeX        produce LaTeX command for making caption.
  316.         explicit    make an explicit box for a fake caption-look-
  317.                 alike caption. see discussion above.
  318.         no        no caption of whatever kind.
  319.  
  320. %fignumber/     string        max char = 10.
  321.                 the number you wish to give this graph to 
  322.                 appear on the fake-caption at bottom. This
  323.                 is ignored if ??caption=LaTeX.
  324.  
  325. %capstring/    YX          
  326.         string         explicit string of less than 80 characters.
  327.                 option YX will print the string of 'Y vs. X'
  328.                 where Y & X are same as the ones specified
  329.                 in the Xaxisstrg & Yaxisstrg above.
  330.  
  331. %labelname/    {labelname}    the name of label you wish to give to the
  332.                 figure. This is ignored if you did not choose
  333.                 LaTeX option on ??caption. MUST have {} around
  334.                 the label name. Also LaTeX doesn't like blanks
  335.                 in the name of a label.
  336.         no        no \label statement desired.
  337.  
  338. %legendloc/[location option letters][/ X Y]
  339.  
  340.         The box is my favorite entity in this program and is very 
  341.         versatile and fun. "location option letters" are any 
  342.         combination of t, b, l, r letters, each occurring max 
  343.         once. These options are identical to general options on
  344.         the LaTeX \makebox command and are interpreted likewise;
  345.         In addition, if you do not want the box at all, then write
  346.         "no" after the first /.
  347.         By default the option is to center along unspecified axis.
  348.         The idea is that you can specify one of    nine points as the
  349.         reference point for location of the box:
  350.  
  351.                   t
  352.              tl    +-----+-----+ tr    t : top
  353.             |           |        b : bottom
  354.               l    +     +     + r        l : left
  355.             |           |        r : right
  356.              bl    +-----+-----+ br    blank: center 
  357.                   b
  358.  
  359.         The ordering is unimportant. You also have an option of 
  360.         explicitly specifying the coordinates in conjunction with 
  361.         the specified reference point. The syntax is that if there 
  362.         are no arguement besides reference letters (upto 2), then I
  363.         will place it appropriately on the graph, in the region 
  364.         specified by the option letters. If you do wish to specify 
  365.         explicit coordinates, then the reference letters, if any,
  366.         must be immediately followed by a / , then X and then Y 
  367.         coordinates; e.g.
  368.  
  369. %legendloc/tl          --> place the legend box in the top left corner of 
  370.                 the graph (I do leave some space between the
  371.                     axes and the box).
  372. %legendloc/tl/ 20 80    --> place the top-left corner of box at (20,80).
  373. %legendloc// 50 50    --> place the box such that its center is at (50,50).
  374. %legendloc/r/ 50 50    --> place the box such that center of the right edge
  375.                 (denoted by r in pic above) is at (50,50). If you
  376.                 did not specify 50,50, then I will calculate and
  377.                 place it exactly at the center-right of the graph.
  378. %legendloc/no        --> no box at all.
  379.  
  380.         NOTE: the second / should be there only if X & Y integer
  381.               coordinates are specified, else the program will bomb.
  382.  
  383. %Xratiog:r     integer1 real2 
  384.                 g:r means graph vs. reality; i.e. to say that
  385.                 integer1 # of units on graph represent real2
  386.                 units of reality; e.g. 10 25 means each 10
  387.                 units on graph = 25 reality units.
  388.                 this ratio is used to translate the data from
  389.                 reality numbers to graph units.
  390.  
  391. %Xorig-num    integer/real    The number that corresponds to the origin
  392.                 along X-axis.
  393. %Xdeltab:n     integer    integer    In the b:n, b -> bar, n-> number
  394.          units   units    the first integer specifies the increment
  395.                 used for putting vertical bars (|) on the
  396.                 X-axis starting from origin and can be
  397.                 different from Xdeltanum (see next parameter).
  398.                 should be specified in graph units.
  399.  
  400.                 The second integer specifies the increment
  401.                 used for putting numbers along the X-axis.
  402.                 It can be different from the first integer.
  403.                 Though there is no restriction, but normally
  404.                 one puts them under the vertical bars or
  405.                 perhaps alternate bars.
  406.                 Should be specified in graph units. Translated
  407.                 to numbers using Xratiog:r. see example below.
  408.  
  409. %Yratiog:r     integer real    -----same as for corresponding X....
  410.  
  411. %Yorig-num     integer        The number that corresponds to the origin
  412.                 along Y-axis.
  413. %Ydeltab:n     integer        same story for these three as above.
  414.  
  415. %plotcharA/    {definition of character number A to be plotted}
  416.         no        these specify the LaTeX statement for the
  417.                 definition of the character to be put at the
  418.                 coordinates, e.g. {circle*{1.0}}
  419.                 no:  means no character with the number 
  420.                      associated with plotchar.
  421.                 see discussion above.
  422. %plotnameA/    string         name for the plotcharA symbol used in the
  423.                 legendbox; is valid only if %plotcharA 
  424.                 is not equal to 'no'.
  425. %plotcharB/    {definition of character number B to be plotted}
  426.         no
  427. %plotnameB/    string        name for character B.
  428. ...
  429. ...
  430. %plotcharF/    {definition of character number F to be plotted}
  431.         no
  432. %plotnameF/    string        name for character F.
  433.  
  434. %%%%%%%%%%            THIS LINE OF 10 %'s IS A MUST. IT ACTS AS THE
  435.                 DELIMITER OF THE ABOVE PARAMETERS.
  436. data follows after above parameters.
  437.  
  438. -----------------------------------------------------------------------------
  439. An example of an inputfile:
  440. -----------------------------------------------------------------------------
  441. %pre&post?/yes
  442. %unitlngth 1.0        
  443. %font-name/{footnotesize}
  444. %picdimens 140 120 -70 -60 
  445. %Xaxisstrg/Number of Hops. 
  446. %Yaxisstrg/\%age of Hops
  447. %??caption/Latex
  448. %fignumber/1-1
  449. %capstring/Half-Length of Symmetric Intervals as \%-age of Lifetime means
  450. %labelname/{my-graph-1}
  451. %legendloc/tr
  452. %Xratiog:r 10 10
  453. %Xdeltab:n 5 10
  454. %Xoriginum 0
  455. %Yratiog:r 10 10
  456. %Ydeltab:n 5 10
  457. %Yoriginum 0
  458. %plotcharA/{\circle*{1.0}}
  459. %plotnameA/Message Switching
  460. %plotcharB/{\makebox(0,0){$\otimes$}}
  461. %plotnameB/Circuit Switching
  462. %plotcharD/no
  463. %plotcharE/no
  464. %%%%%%%%%% 
  465. A 20 20
  466. A 20 -20
  467. A -20 20
  468. A -20 -20
  469. B 30 10
  470. B 30 -10
  471. B -30 10
  472. B -30 -10
  473. ------------------------------------------------------------------------------
  474. The output produced by the above input:
  475. ------------------------------------------------------------------------------
  476. \documentstyle{article}
  477. \setlength{\topmargin}{0cm}
  478. \setlength{\headheight}{1cm}
  479. \setlength{\footskip}{3cm}
  480. \setlength{\oddsidemargin}{0cm}
  481. \setlength{\textwidth}{170.00mm}
  482. \pagestyle{empty}     % => no page number 
  483. \begin{document}
  484.  
  485. \newcommand{\xaxis}{Number of Hops. } % the literal for X-axis
  486. \newcommand{\yaxis}{\%age of Hops} % the literal for Y-axis
  487. \newcommand{\pcharA}{\circle*{1.0}}
  488. \newcommand{\pcharB}{\makebox(0,0){$\otimes$}}
  489.  
  490. \begin{footnotesize}
  491. \begin{figure}[p]     %you might want different options here
  492. \unitlength = 1.00mm
  493. \begin{center}
  494. \begin{picture}(150,130)(-80,-70)
  495. \thicklines
  496. \put(0,0){\vector(1,0){70}}
  497. \put(72,0){\makebox(0,0)[l]{X}}
  498. \put(0,0){\vector(-1,0){70}}
  499. \put(-72,0){\makebox(0,0)[r]{X}}
  500. \put(0,0){\vector(0,1){60}}
  501. \put(0,62){\makebox(0,0)[b]{Y}}
  502. \put(0,0){\vector(0,-1){60}}
  503. \put(0,-62){\makebox(0,0)[t]{Y}}
  504. \thinlines
  505. \multiput(0,-1)(5,0){14}{\line(0,1){2}}
  506. \multiput(0,-1)(-5,0){14}{\line(0,1){2}}
  507. \multiput(-1,0)(0,5){12}{\line(1,0){2}}
  508. \multiput(-1,0)(0,-5){12}{\line(1,0){2}}
  509. % Add a line similar to next one if number at origin desired.
  510. \put(10,-2){\makebox(0,0)[t]{10}}
  511. \put(20,-2){\makebox(0,0)[t]{20}}
  512. \put(30,-2){\makebox(0,0)[t]{30}}
  513. \put(40,-2){\makebox(0,0)[t]{40}}
  514. \put(50,-2){\makebox(0,0)[t]{50}}
  515. \put(60,-2){\makebox(0,0)[t]{60}}
  516. \put(-10,-2){\makebox(0,0)[t]{-10}}
  517. \put(-20,-2){\makebox(0,0)[t]{-20}}
  518. \put(-30,-2){\makebox(0,0)[t]{-30}}
  519. \put(-40,-2){\makebox(0,0)[t]{-40}}
  520. \put(-50,-2){\makebox(0,0)[t]{-50}}
  521. \put(-60,-2){\makebox(0,0)[t]{-60}}
  522. \put(-2,10){\makebox(0,0)[r]{10}}
  523. \put(-2,20){\makebox(0,0)[r]{20}}
  524. \put(-2,30){\makebox(0,0)[r]{30}}
  525. \put(-2,40){\makebox(0,0)[r]{40}}
  526. \put(-2,50){\makebox(0,0)[r]{50}}
  527. \put(-2,-10){\makebox(0,0)[r]{-10}}
  528. \put(-2,-20){\makebox(0,0)[r]{-20}}
  529. \put(-2,-30){\makebox(0,0)[r]{-30}}
  530. \put(-2,-40){\makebox(0,0)[r]{-40}}
  531. \put(-2,-50){\makebox(0,0)[r]{-50}}
  532. \put(70,60){\makebox(0,0)[tr]{\fbox{\shortstack[l]{
  533.  {\makebox(4,2)[lb]{\put(2,1){\pcharA}}}: Message Switching\\
  534.  {\makebox(4,2)[lb]{\put(2,1){\pcharB}}}: Circuit Switching\\
  535.  {\makebox(4,4)[b]{X}}: \xaxis \\
  536.  {\makebox(4,2)[b]{Y}}: \yaxis
  537.  }}}}
  538. % beginning of data
  539. \put(20.00000,20.00000){\pcharA}
  540. \put(20.00000,-20.00000){\pcharA}
  541. \put(-20.00000,20.00000){\pcharA}
  542. \put(-20.00000,-20.00000){\pcharA}
  543. \put(30.00000,10.00000){\pcharB}
  544. \put(30.00000,-10.00000){\pcharB}
  545. \put(-30.00000,10.00000){\pcharB}
  546. \put(-30.00000,-10.00000){\pcharB}
  547. % end of data
  548. \end{picture}
  549. \end{center}
  550. % if the caption line is longer than the graphwidth,use a
  551. % \parbox[t]{...mm}{.......} like statement for the argument
  552. % with suitable args for parbox to get things centered.
  553. \caption{\protect\normalsize 
  554. Half-Length of Symmetric Intervals as \%-age of Lifetime means
  555. }
  556. \label{my-graph-1}
  557. \end{figure}
  558.  
  559. \end{footnotesize}
  560.  
  561. \end{document}
  562. ------------------------------------------------------------------------------
  563. END OF DOC.
  564.